<template>
  <div class="infoContent">
    <div class="text">视点:</div>
    <div>
      <div class="viewpoint">
        <div class="viewItem" style="padding-left: 7px">
          <div class="x">{{ info.centerCoord[0] }}</div>
          <div class="y">{{ info.centerCoord[1] }}</div>
          <div class="z">{{ info.coordZ }}</div>
        </div>
        <div class="img">
          <img src="@/assets/image/colip.png" alt="" />
        </div>
        <div class="viewItem">
          <div class="angle">
            <div class="title">旋转角</div>
            <div class="content">{{ info.pitch }}</div>
          </div>
        </div>
        <div class="img">
          <img src="@/assets/image/colip.png" alt="" />
        </div>
        <div class="viewItem">
          <div class="angle">
            <div class="title">俯仰角</div>
            <div class="content">{{ info.heading }}</div>
          </div>
        </div>
        <div class="img">
          <img src="@/assets/image/colip.png" alt="" />
        </div>
        <div class="viewItem">
          <div class="angle">
            <div class="title">焦点距离</div>
            <div class="content">{{ info.distance }}</div>
          </div>
        </div>
        <div class="img">
          <img src="@/assets/image/colip.png" alt="" />
        </div>
      </div>
    </div>
    <div class="text">JSON:</div>
    <div class="viewJson">
      <textarea disabled>
        {{ info }}
      </textarea>
      <div class="img">
        <img src="@/assets/image/colip.png" alt="" />
      </div>
    </div>
    <div></div>
    <div class="button">确定</div>
  </div>
</template>
<style lang="scss" scoped>
.infoContent {
  width: 100%;
  height: fit-content;
  display: grid;
  grid-template-columns: 2fr 11fr;
  padding: 16px 23px;
  gap: 5px;
  .text {
    text-align: center;
    line-height: 24px;
    height: 24px;
  }
  .viewpoint {
    width: 100%;
    height: 140px;
    display: grid;
    grid-template-columns: 12fr 1fr;
    gap: 5px;
    .viewItem {
      height: 24px;
      width: 100%;
      display: flex;
      align-items: center;
      justify-content: space-between;
      .x,
      .y,
      .z {
        height: 100%;
        line-height: 24px;
        padding-left: 10px;
        width: 83px;
        border: 1px solid #4d505d;
        position: relative;
        font-size: 12px;
        color: #ccc;
        box-sizing: border-box;
      }
      .x::before {
        content: "X";
        display: inline-block;
        width: 10px;
        background-color: #c23434;
        text-align: center;
        border-radius: 2px;
        position: absolute;
        left: -7px;
        z-index: 1;
        height: 24px;
        line-height: 24px;
      }
      .y::before {
        content: "Y";
        display: inline-block;
        width: 10px;
        background-color: #309649;
        text-align: center;
        border-radius: 2px;
        position: absolute;
        left: -7px;
        z-index: 1;
        height: 24px;
        line-height: 24px;
      }
      .z::before {
        content: "Z";
        display: inline-block;
        width: 10px;
        background-color: #2c7eaf;
        text-align: center;
        border-radius: 2px;
        position: absolute;
        left: -7px;
        z-index: 1;
        height: 24px;
        line-height: 24px;
      }
      .angle {
        width: 100%;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: start;
        .title {
          width: 64px;
          background-color: #37383c;
          border: 1px solid #4d505e;
          border-right: 0;
          padding: 0;
          text-align: center;
          border-radius: 2px 0 0 2px;
        }
        .content {
          font-size: 12px;
          height: 24px;
          flex: 1;
          border: 1px solid #4d505e;
          background-color: #272729;
          padding: 0 5px;
          color: #ccc;
          border-radius: 2px;
          line-height: 24px;
        }
      }
    }
  }
  .viewJson {
    width: 100%;
    display: grid;
    grid-template-columns: 12fr 1fr;
    gap: 5px;
  }
  .button {
    width: 73px;
    background: #105ae4;
    border: 1px solid #105ae4;
    height: 26px;
    line-height: 26px;
    text-align: center;
    color:#fff;
    margin-left: 280px;
    border-radius: 2px;
    margin-top: 5px;
  }
}
.img {
  width: 18px;
  height: 18px;
  img {
    width: 100%;
    height: 100%;
  }
}
textarea {
  width: 100%;
  font-size: 12px;
  border: 1px solid #4d505e;
  background-color: #272729;
  padding: 5px 5px;
  color: #ccc;
  box-sizing: border-box;
  border-radius: 2px;
  resize: none; /* 禁止用户调整textarea的大小 */
  overflow-y: auto; /* 隐藏额外内容 */
  min-height: 150px; /* 设置最小高度 */
  max-height: 150px; /* 设置最大高度 */
}
::-webkit-scrollbar {
    width: 14px;
    height: 14px;
}
::-webkit-scrollbar-thumb {
    background: #656670;
    border: 0 solid #2b2c2f;
    border-width: 0 1px;
}
::-webkit-scrollbar-track {
    padding: 2px;
    width: 8px;
    background: #2b2c2f;
}
</style>
<script setup>
defineProps({
    info:{
        type:Object,
        default:()=>{}
    }
})
</script>
